#HOST = '10.10.17.163'
HOST = '10.10.217.148'
import time
import beanstalkc
from my.m import myjob

from django.conf import settings
from my.settings import DATABASES
#settings.configure(DATABASES=DATABASES)
#from my.m.models import Video, Status

def transcode(videoid):
    c = beanstalkc.Connection(host=HOST)
    c.use(myjob.Transcode.sztube)
    #v = Video(src='in/1.mov'%locals())
    #v.save()
    #s = myjob.Transcode(videoid=v.id).dump()
    s = myjob.Transcode(videoid=videoid).dump()
    c.put(s)
    c.close()


#v = Video(src='in/clock.avi'%locals())





'''
v = Video(src='we2.mp4', dst='we2.mp4')
v.save()
c.use(myjob.Catalog.sztube)
s = myjob.Catalog(videoid=v.id).dump()
c.put(s)
'''

'''
for i in range(0,100):
    v = Video(src='%(i)d.mov'%locals())
    v.save()
    s = myjob.Transcode(videoid=v.id).dump()
    c.put(s)
'''    
